home *** CD-ROM | disk | FTP | other *** search
- Path: gryphon.phoenix.net!usenet
- From: brucew@phoenix.net (Bruce Wedding)
- Newsgroups: comp.lang.c
- Subject: Re: changing strings via pointers
- Date: Thu, 29 Feb 1996 02:54:42 GMT
- Organization: BranPaul Systems
- Message-ID: <4h34jv$1t4@gryphon.phoenix.net>
- References: <1996Feb22.125436.25503@leeds.ac.uk> <4gls59$rct@clarknet.clark.net>
- NNTP-Posting-Host: dial125.phoenix.net
- X-Newsreader: Moe's Newsreader
-
- In comp.lang.c
- yom@clark.net (yom) wrote:
-
- >You can use strchr string function to get the pointer to a newline
- >character in your character array, and set what the pointer points
- >to to NULL (0).
- >
- > char *b;
- > if (b = strchr(buffer,'\n'))
- > *b = 0;
-
- or you could simplify and use strtok(buffer, "\n");
-
-
- Bruce D. Wedding Have Compiler, Will Travel!
- Perspicacious Programming Performed Promptly
- Katy, Texas, USA, Planet Earth, Milkyway Galaxy, Known Universe
-
-